The invention relates to a device for measuring an angle between a magnetic field and a magnetoresistive sensor which supplies at least two mutually 90xc2x0 phase-shifted electrical sensor signals which are supplied to an analog/digital converter, and downstream of which an angle calculating device is connected.
Such devices for the contactless measuring of angles are used in the field of motorcars, for example for detecting the angles of throttle valves or the steering angle. This angle measurement is based on the magnetoresistive effect. A ferromagnetic layer in the sensor through which a current is passed is exposed to a magnetic field here, as a result of which the resistance of the layer changes. A change in the resistance is caused through a change in the position of the sensor in relation to the magnetic field. Such a sensor is referred to as MR sensor hereinafter.
The Philips Semiconductors data sheet UZZ9000 describes a system which calculates an angle between an MR sensor and a permanent magnet from two signals which are 90xc2x0 phase-shifted relative to one another. This sensor comprises two mutually interlocking Wheatstone bridges which are mutually arranged at an angle of 45xc2x0 and which supply sinusoidal signals phase-shifted by 90xc2x0. These Wheatstone bridges exhibit a drift behavior which is dependent on the individual device and not systematic. Said bridge circuits do not operate fully symmetrically owing to manufacturing tolerances of the resistances, which gives rise to a static offset in the sensor signals. To balance the sensor signals affected by static offset in the known system, a once and for all compensation of the static offset is carried out at room temperature by the application of external compensation voltages. In addition, dynamic offsets arise during operation of the angle measuring device owing to temperature changes and ageing. These offsets falsify the measuring result considerably and are not dealt with in the once and for all compensation.
It is an object of the invention to provide a device which carries out an automatic offset compensation of the static and dynamic offsets continuously.
This object is achieved in that the absolute value |r| of the two sensor signals x and y is calculated in a total calculation device from the equation |r|={square root over (y2+x2)}, in that the change in the absolute value of the sensor signals is determined in dependence on the calculated angle, and in that an offset control of the sensor signals x and y is carried out in dependence on said change in absolute value.
The device according to the invention comprises an MR sensor which supplies two electrical sensor signals which are mutually phase-shifted by 90xc2x0 upon exposure to a magnetic field. After said two sinusoidal sensor signals have been A/D converted, the angle between the MR sensor and the magnetic field is calculated in the angle calculating device. Since these two sinusoidal signals are at right angles to one another, the complex number theory can accordingly be applied, wherein the first sensor signal x, for example, is the real component and the second sensor signal y is the imaginary component of a complex number, or the sensor signal x represents the sine and the sensor signal y represents the cosine of one and the same angle. The absolute value of these two sensor signals is calculated in the total calculation device. In addition, the change in absolute value is also calculated for the calculated angle between the MR sensor and the magnetic field. A controller calculates from this change in absolute value, or alternatively from the angle gradient, a DC voltage which is supplied to controllable preamplifiers so as to influence the two sensor signals coming from the MR sensor such that the offsets to which the sensor signals are subject are compensated, and accordingly the change in absolute value of the angle is reduced and indeed eliminated in the ideal case. The controllable preamplifiers are connected upstream of the AMD converter and amplify the relevant signal originating from the sensor. An externally supplied DC voltage which is dependent on the offset values calculated by the controller is additively superimposed on the sensor signals in the controllable preamplifier. The offsets which falsify the test result are thus compensated, so that no change in the absolute value of the angle will be present upon the next calculation of the absolute value change.
An advantage of this invention over the prior art is that the calculation of the change in absolute value compensates not only dynamic offsets which arise owing to ageing and temperature fluctuations during the measurement, but also the static offsets which arise from the non-symmetrical central voltage of the Wheatstone bridges which are present in the sensor. A continuous offset compensation is possible because the calculation of the absolute value takes place in parallel to the calculation of the angle in the calculation device.
It is found to be advantageous in an embodiment of the invention to supplement the device with a memory in which the offset values are stored so as to achieve a faster compensation of the offsets at the start of an angle measurement.
The absolute sensor signal value is differentiated with respect to the angle, whereby high-frequency interference signals are intensified, so that it is advantageous to combine the differentiation with a low-pass filtering operation.
It may be advantageously provided that the sensor signals are first A/D converted and then influenced by means of a correction signal calculated in dependence on the change in absolute value, such that the change in absolute value is reduced and eliminated.
In a further embodiment of the invention, a CORDIC algorithm is used for calculating the angle and the absolute value of the sensor signal. The CORDIC algorithm is an approximation method. It is based on basic mathematical functions, such as addition and arithmetic shifting, as well as on a read-out of tabled values. In the angle determination, a pointer defined by its co-ordinates in the complex plane is rotated stepwise until the imaginary component disappears and the pointer comes to lie on the real axis after a number of rotation operations. Once this termination criterion has been reached, the desired angle is derived from the number of rotation steps.